#include "opencv/highgui.h"

int main( int argc, char** argv ) {

	IplImage* img1 = cvLoadImage( argv[1], 0 );
	IplImage* img2 = cvLoadImage( argv[2], 2 );
	IplImage* img3 = cvCreateImage(cvGetSize(img1), img1->depth, 1);
	cvNamedWindow( "img1", CV_WINDOW_AUTOSIZE );
	cvShowImage( "img1", img1 );
	cvNamedWindow( "img2", CV_WINDOW_AUTOSIZE );
	cvShowImage( "img2", img2 );
	
	cvAnd(img1, img2, img3,0);

	cvNamedWindow( "suma", CV_WINDOW_AUTOSIZE );
	cvShowImage( "suma", img3 );
	
	cvWaitKey(0);
	cvReleaseImage( &img1 );
	cvDestroyWindow( "img1" );
	cvReleaseImage( &img2 );
	cvDestroyWindow( "img2" );
	cvReleaseImage( &img3 );
	cvDestroyWindow( "suma" );
	
	return 0;
}
